<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>小鹿直播数据</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            margin: 0 auto;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px;
            list-style: none;
            box-shadow: 0 2px 4px #eeeeee;
        }
        ul > li {
            padding: 6px 16px;
            margin: 0 5px;
            border-right: 1px solid #f7f7f7;
            border-bottom: 1px solid transparent;
            cursor: pointer;
        }
        ul > li:last-child{
            border-right: none;
        }
        li:hover, li:focus, .active {
            color: #ff6615;
            border-bottom: 1px solid #ff6615;
        }
    </style>
</head>
<body>

<ul id="nav">
    <li class="active">首页</li>
    <li><a href="/incom">主播流水</a></li>
    <li><a href="/user">用户充值去向</a></li>
    <li><a href="/onlyanchor?uid=0">主播历史流水</a></li>
    <li><a href="/onlyrecharge?uid=0">历史充值去向</a></li>
</ul>

<script>
    function removeActiveClass(node) {
        node.className = '';
    }

    let menus = document.querySelectorAll('#nav');
    menus.forEach(function (value, index) {
        value.addEventListener('click', function (e) {
            var target = e.target;
            Array.prototype.forEach.call(document.querySelectorAll('#nav li'), removeActiveClass);
            target.className = 'active';
        })
    });
</script>
</body>
</html>